package com.pai4j.zwiki.repository;

import com.pai4j.zwiki.domain.entity.ThesisGenerationEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * 论文生成数据访问层
 *
 * @author pai4j
 * @since 2025-10-12
 */
@Repository
public interface ThesisGenerationRepository extends JpaRepository<ThesisGenerationEntity, Long> {

    /**
     * 通过任务ID查找论文
     */
    Optional<ThesisGenerationEntity> findByTaskId(String taskId);

    /**
     * 删除指定任务的论文
     */
    void deleteByTaskId(String taskId);
}

